import request from '@/utils/request'
// 获取公司组织架构
export const getDepartments = () => {
  return request.get('/company/department')
}

// 获取负责人列表
export const getEmployeesSimple = () => {
  return request.get('/sys/user/simple')
}

// 新增子部门接口
/**
 *  需要的参数
 * @param {code,introduce,manager,name,pid} data
 * @returns
 */
export const addDepartments = data => {
  return request.post('/company/department', data)
}

// 获取部门详情
export const getDepartmentsDetail = (id) => {
  return request.get(`/company/department/${id}`)
}

// 编辑功能接口
export const editDepartments = data => {
  return request.put(`/company/department/${data.id}`, data)
}
// export function updateDepartments(data) {
//   return request({
//     url: `/company/department/${data.id}`,
//     method: 'put',
//     data
//   })
// }

// 删除功能接口
export const delDepartment = id => {
  return request.delete(`/company/department/${id}`)
}
